<!-- 企业信息展示界面，使用卡片进行信息渲染 -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css">
    <script src="layui/layui.js" type='text/javascript'></script>

    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>

    <title>企业信息显示</title>
</head>
<body>
<!-- 渲染的加载框位置  -->
<div id='infoDiv'>

</div>
<button type='button' class="layui-btn layui-btn-radius layui-btn-primary layui-btn-sm" onclick='img_upload();'>上传营业执照
</button>

<!-- 	<script type='text/html'> -->
<!-- 界面渲染，对卡片信息进行的渲染加载 -->
<script type='text/html' id='info'>
    <div class='layui-card'>
        <div class='layui-fluid  layui-bg-gray'>
            <div class="layui-row layui-col-space10">
                <div class='layui-col-md4'>
                    <div class="layui-card">
                        <div class="layui-card-header">企业名称</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.ename}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4'>
                    <div class="layui-card">
                        <div class="layui-card-header">企业联系人</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.contacts}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4'>
                    <div class="layui-card">
                        <div class="layui-card-header">企业性质</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.type}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">企业电话</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.telephone}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4'>
                    <div class="layui-card">
                        <div class="layui-card-header">企业网址</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.website}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">企业邮箱</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.email}}</cite></p>
                        </div>
                    </div>
                </div>
                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">企业地址</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.province}}{{d.city}}{{d.area}}{{d.address}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">企业类型</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.organize}}</cite></p>
                        </div>
                    </div>
                </div>

                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">注册资本</div>
                        <div class="layui-card-body">
                            <p><cite>{{d.capital}}万元</cite></p>
                        </div>
                    </div>
                </div>


                <div class='layui-col-md4 '>
                    <div class="layui-card">
                        <div class="layui-card-header">营业执照</div>
                        <div class="layui-card-body ">
                            <img class='dialog' src="{{d.license}}" id='imgshow' style="width:100px;height:120px">
                            <button type='button' class="layui-btn layui-btn-xs layui-btn-normal" onclick="showimg();">
                                查看大图
                            </button>


                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</script>

</body>

<style type='text/css'>
    .layui-card-body {
        height: 120px;
        color: #009F95;
        font-weight: 700;
    }
</style>

<!--后台的数据向前端进行加载-->
<script type="text/javascript">
    layui.use(['layer'],function () {
        var layer = layui.layer;
        var laytpl = layui.laytpl;
        $.ajax({
            async: false,
            url: "/enter/viewInfo",
            type: 'post',
            success: function (data) {
                var obj = JSON.parse(data);
                var enterprise = obj.data.enterprise;
                var data1 = {
                    "code": enterprise.code,
                    "contacts": enterprise.contacts,
                    "email": enterprise.email,
                    "ename": enterprise.ename,
                    "enterpriseId": enterprise.enterpriseId,
                    "license": enterprise.license,
                    "number": enterprise.number,
                    "telephone": enterprise.telephone,
                    "website": enterprise.website,
                    "type":enterprise.type,

                    "province":enterprise.province,
                    "city":enterprise.city,
                    "area":enterprise.area,
                    "address":enterprise.address,

                    "organize":enterprise.organize,
                    "capital":enterprise.capital,
                    "license":enterprise.license
                };
                var infoTpl = info.innerHTML
                    , infoDiv = document.getElementById('infoDiv');
                laytpl(infoTpl).render(data1,function (html) {
                    infoDiv.innerHTML = html;
                });
            }
        });
        // var data1 = { "ename": "煤炭公司"
        // , "telephone": "0534-8241222"
        // ,"email": "mzd19971122@126.com"
        // ,"contacts": "马先生"
        // , "need":120
        // , "website":"www.test.com"
        // ,"province":"山东省",
        // "city":"泰安市",
        // "county":"泰山区",
        // "detail_add":"岱宗大街61号"
        // ,"type":"其他类型企业"
        // ,"epprop":"世界500强企业",
        // "imgpath":"002.jpeg",
        // };

        // data=document.getElementById('infoDiv');
    });
</script>


<script type='text/javascript'>
    //<!-- 使用弹出层显示大图 -->
    function showimg() {
        // alert('测试');
        var layer = layui.layer;
        var $=layui.$;
        var img_src = $('.dialog').attr('src');//依赖jquery的解释
        var img = "<img src='" + img_src + "'/>";
        layer.open({
            type: 1,
            title: '营业执照',
            maxmin: true,
            anim: 4,
            content: img
        });
    }

    function img_upload() {
        var layer = layui.layer;
        layer.open({
            type: 2,
            title: '上传营业执照',
            maxmin: true,
            anim: 3,
            content: 'img_upload.html',
            area: ['500px', '600px']

        });

    }

    function file_upload() {
        var layer = layui.layer;
        layer.open({
            type: 2,
            title: '上传招聘简章',
            maxmin: true,
            anim: 3,
            content: 'file_upload.html',
            area: ['500px', '600px']

        });

    }
</script>
<!-- 使用弹出层对文件进行上传操作 -->
<script type='text/text/javascript'>

</script>

</html>
